package com.xd.center.http.builder;

import com.alibaba.fastjson.JSON;

import java.lang.reflect.Type;

/**
 * 解码
 */
public interface HttpDecoder {

  Object decoder(Object object, Type type, MethodMetadata methodMetadata);

  class Default implements HttpDecoder {

    @Override
    public Object decoder(Object object, Type type, MethodMetadata methodMetadata) {
      return JSON.parseObject(object.toString(), type);
    }
  }
}
